package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.AtmCassetteBrandMapper;
import com.zone.service.domain.AtmCassetteBrand;
import com.zone.service.service.IAtmCassetteBrandService;

/**
 * ATM钞箱品牌Service业务层处理
 * 
 * @author liuyang
 * @date 2025-10-30
 */
@Service
public class AtmCassetteBrandServiceImpl implements IAtmCassetteBrandService 
{
    @Autowired
    private AtmCassetteBrandMapper atmCassetteBrandMapper;

    /**
     * 查询ATM钞箱品牌
     * 
     * @param id ATM钞箱品牌主键
     * @return ATM钞箱品牌
     */
    @Override
    public AtmCassetteBrand selectAtmCassetteBrandById(Long id)
    {
        return atmCassetteBrandMapper.selectAtmCassetteBrandById(id);
    }

    /**
     * 查询ATM钞箱品牌列表
     * 
     * @param atmCassetteBrand ATM钞箱品牌
     * @return ATM钞箱品牌
     */
    @Override
    public List<AtmCassetteBrand> selectAtmCassetteBrandList(AtmCassetteBrand atmCassetteBrand)
    {
        return atmCassetteBrandMapper.selectAtmCassetteBrandList(atmCassetteBrand);
    }

    /**
     * 新增ATM钞箱品牌
     * 
     * @param atmCassetteBrand ATM钞箱品牌
     * @return 结果
     */
    @Override
    public int insertAtmCassetteBrand(AtmCassetteBrand atmCassetteBrand)
    {
        atmCassetteBrand.setCreateTime(DateUtils.getNowDate());
        return atmCassetteBrandMapper.insertAtmCassetteBrand(atmCassetteBrand);
    }

    /**
     * 修改ATM钞箱品牌
     * 
     * @param atmCassetteBrand ATM钞箱品牌
     * @return 结果
     */
    @Override
    public int updateAtmCassetteBrand(AtmCassetteBrand atmCassetteBrand)
    {
        atmCassetteBrand.setUpdateTime(DateUtils.getNowDate());
        return atmCassetteBrandMapper.updateAtmCassetteBrand(atmCassetteBrand);
    }

    /**
     * 批量删除ATM钞箱品牌
     * 
     * @param ids 需要删除的ATM钞箱品牌主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteBrandByIds(Long[] ids)
    {
        return atmCassetteBrandMapper.deleteAtmCassetteBrandByIds(ids);
    }

    /**
     * 删除ATM钞箱品牌信息
     * 
     * @param id ATM钞箱品牌主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteBrandById(Long id)
    {
        return atmCassetteBrandMapper.deleteAtmCassetteBrandById(id);
    }
    
    /**
     * 批量新增ATM钞箱品牌
     * 
     * @param atmCassetteBrandList ATM钞箱品牌列表
     * @return 结果
     */
    @Override
    public int insertAtmCassetteBrandList(List<AtmCassetteBrand> atmCassetteBrandList)
    {
        int rows = 0;
        for (AtmCassetteBrand atmCassetteBrand : atmCassetteBrandList) {
            atmCassetteBrand.setCreateTime(DateUtils.getNowDate());
            rows += atmCassetteBrandMapper.insertAtmCassetteBrand(atmCassetteBrand);
        }
        return rows;
    }
    
    /**
     * 批量插入ATM钞箱品牌数据
     *
     * @param atmCassetteBrandList ATM钞箱品牌列表
     * @return 结果
     */
    @Override
    public int batchInsertAtmCassetteBrand(List<AtmCassetteBrand> atmCassetteBrandList) {
        return atmCassetteBrandMapper.batchInsertAtmCassetteBrand(atmCassetteBrandList);
    }
}